Skip to content

Revert "[http-client-csharp] Rename input-only Content model suffix to Request" - #12513

Closed
JoshLove-msft wants to merge 1 commit into
mainfrom
revert-12493-joshlove-msft-model-suffix-renaming
Closed

JoshLove-msft wants to merge 1 commit into
mainfrom
revert-12493-joshlove-msft-model-suffix-renaming

Conversation

@JoshLove-msft

Copy link
Copy Markdown
Contributor

Reverts #12493

@microsoft-github-policy-service microsoft-github-policy-service Bot added emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp labels Nov 6, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@12513

commit: d9d8756

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing name reservation lets WidgetResponse and WidgetResult collide after the still-enabled Response-to-Result conversion, overwriting a provider and sharing an output filename; collision resolution and regression tests must be retained.

1 open issue
What changed in this PR

Reverts #12493 in the C# client generator, restoring input-only model names ending in Content instead of converting them to Request.

Changes:

  • Removes the Content suffix conversion and shared name-collision resolution.
  • Removes associated tests and fixtures, restoring response-only naming tests.
  • Updates naming documentation to describe the reverted behavior.

All paths below are relative to packages/http-client-csharp/generator/.

File Description
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ResponseSuffixPreservesExistingName/​ExistingModels.cs Removes existing-name fixtures for Content models.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ResponseSuffixPreservesCustomName/​CustomizedModels.cs Removes customized Content model fixtures.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ModelSuffixMappingBelongsToOriginalInput/​CustomizedModel.cs Deletes customization-ownership fixture.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ModelSuffixFallbackAvoidsMappedInputName/​CustomizedModel.cs Deletes mapped fallback-name fixture.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ModelSuffixCollisionPreservesMappedSuffixName/​CustomizedModel.cs Deletes mapped suffix-collision fixture.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ModelSuffixCollisionPreservesCustomName/​CustomizedModel.cs Deletes custom-name collision fixture.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​TestData/​ModelProviderTests/​TestBuildName_ModelSuffixCollisionPreservesContractName/​ExistingModel.cs Deletes prior-contract collision fixture.
Microsoft.TypeSpec.Generator/​test/​Providers/​ModelProviders/​ModelProviderTests.cs Removes content-renaming and collision tests; restores response-only cases.
Microsoft.TypeSpec.Generator/​src/​TypeFactory.cs Removes cached model-name resolution and reservations.
Microsoft.TypeSpec.Generator/​src/​SourceInput/​SourceInputModel.cs Removes the customization-mapping lookup helper.
Microsoft.TypeSpec.Generator/​src/​Providers/​TypeProvider.cs Restores instance-only name normalization.
Microsoft.TypeSpec.Generator/​src/​Providers/​ModelProvider.cs Restores response-only suffix conversion and compatibility lookup.
Microsoft.TypeSpec.Generator.ClientModel/​test/​Providers/​ScmModelProvider/​TestData/​ScmModelProviderTests/​ModelSuffixDoesNotCollideWithCustomizedClient/​CustomizedClients.cs Deletes customized-client collision fixtures.
Microsoft.TypeSpec.Generator.ClientModel/​test/​Providers/​ScmModelProvider/​TestData/​ScmModelProviderTests/​ContentSuffixUsageIsReflectedInGeneratedCode(Output).cs Deletes output-only model baseline.
Microsoft.TypeSpec.Generator.ClientModel/​test/​Providers/​ScmModelProvider/​TestData/​ScmModelProviderTests/​ContentSuffixUsageIsReflectedInGeneratedCode(Input).cs Deletes input-only model baseline.
Microsoft.TypeSpec.Generator.ClientModel/​test/​Providers/​ScmModelProvider/​TestData/​ScmModelProviderTests/​ContentSuffixUsageIsReflectedInGeneratedCode(Input, Output).cs Deletes shared input/output model baseline.
Microsoft.TypeSpec.Generator.ClientModel/​test/​Providers/​ScmModelProvider/​ScmModelProviderTests.cs Removes generated-output and client-collision tests.
Microsoft.TypeSpec.Generator.ClientModel/​src/​ScmTypeFactory.cs Removes client-name reservations for model naming.
Microsoft.TypeSpec.Generator.ClientModel/​src/​Providers/​ClientProvider.cs Removes the client collision-name helper.
docs/​naming-conventions.md Removes content-renaming and collision-resolution documentation.

Review effort: Balanced

}

return name;
return $"{normalizedName[..^ResponseSuffix.Length]}Result";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants